package com.cesgroup.zw.spring.boot.library.echarts.barAndPie.simple;

import com.cesgroup.zw.spring.boot.echarts.component.series.Bar;
import com.cesgroup.zw.spring.boot.echarts.model.style.ItemStyle;

/**
 * @author ytj
 * @date 2019/7/8 14:14
 */
@SuppressWarnings("serial")
public class BarSimpleSeries extends Bar{
    public BarSimpleSeries(BarAndPieSimpleParam param,String name){
        if("衬衫".equals(name))
            this.demo1(param,name,"#C1232B");
        else if("羊毛衫".equals(name))
            this.demo1(param,name,"#B5C334");
        else if("雪纺衫".equals(name))
            this.demo1(param,name,"#FCCE10");
        else if("裤子".equals(name))
            this.demo1(param,name,"#E87C25");
        else if("高跟鞋".equals(name))
            this.demo1(param,name,"#27727B");
        else if("袜子".equals(name))
            this.demo1(param,name,"#FE8463");
    }
    public void demo1(BarAndPieSimpleParam param,String name,String color){
        this.setName(name);
        this.setType("bar");
        this.setBarGap("-100%");
        this.setItemStyle(new ItemStyle(){{
            this.setColor(color);
        }});
        this.setData(param.getDataset().get(name));
    }

}
